package cn.initcap.designpattern.pattern.structural.composite;

/**
 * @author initcap
 * @date 2018/8/28 AM9:12
 */
public class Course extends BaseCatalogComponent {
    private String name;
    private double price;

    public Course(String name, double price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public String getName(BaseCatalogComponent baseCatalogComponent) {
        return this.name;
    }

    @Override
    public double getPrice(BaseCatalogComponent baseCatalogComponent) {
        return this.price;
    }

    @Override
    public void print() {
        System.out.println("BaseCourse Name:" + name + " Price:" + price);
    }

}
